<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>登录界面</title>
    <link rel="stylesheet" href="/css/site.min.css"/>
    <link rel="stylesheet" href="/css/style.css"/>
    <script src="/js/jquery-1.11.3.js"></script>
    <script src="/js/bootstrap.min.js"></script>
    <script src="/js/angular.js"></script>

    <style>
        h1 {
            text-align: center;
        }
        body{
            background:url("../../images/login.jpg") no-repeat;
        }
    </style>
</head>
<body>
<!--导航栏-->
<!--注册页面-->
<div class="container" style="border-radius: 20px;background-color: #fff;width: 30%; height: 250px;margin-top: 14%;margin-left: 31%;">

    <div style="margin-top: 5%;">
        <form action="login" method="post" role="form" name="createContactForm"
              ng-controller="ContactCreateController" style="margin-left:10%;">
            <!-- 帐号 -->
            <div class="form-group has-feedback"
                 ng-class="{'has-success' : !createContactForm.UserName.$pristine && createContactForm.UserName.$valid, 'has-error' : !createContactForm.UserName.$pristine && createContactForm.UserName.$invalid }">
                <label for="UserName"><span style="color:#000;">账户名</span></label>
                <input type="text" class="form-control clearText" ng-model="userName" name="txtLoginName" autofocus=""
                       required
                       ng-maxlength=30 style="width:25em;border-radius: 3em;">

                <div ng-show="!createContactForm.UserName.$pristine && createContactForm.UserName.$valid">
                    <span class="glyphicon glyphicon-ok form-control-feedback"></span>
                </div>
                <div ng-show="!createContactForm.UserName.$pristine && createContactForm.UserName.$invalid">
                    <span class="glyphicon glyphicon-remove form-control-feedback"></span>
                </div>
            </div>
            <!-- 密码 -->
            <div class="form-group has-feedback"
                 ng-class="{'has-success' : !createContactForm.UserMail.$pristine && createContactForm.UserMail.$valid, 'has-error' : !createContactForm.UserMail.$pristine && createContactForm.UserMail.$invalid }">
                <label for="userPassword"><span style="color:#000;">密码</span></label>
                <input type="password" class="form-control clearText" ng-model="userPassword" name="txtPassword"
                       required
                       ng-maxlength=30 style="width:25em;border-radius: 3em;">

                <div ng-show="!createContactForm.UserMail.$pristine && createContactForm.UserMail.$valid">
                    <span class="glyphicon glyphicon-ok form-control-feedback"></span>
                </div>
                <div ng-show="!createContactForm.UserMail.$pristine && createContactForm.UserMail.$invalid">
                    <span class="glyphicon glyphicon-remove form-control-feedback"></span>
                </div>
            </div>

            <!-- 提交按钮 -->
            <div class="form-group">
                <div ng-show="!createContactForm.$valid">
                    <div style="margin-top:3em;margin-right: 500px;border: none;">
                        <!--登录验证跳转-->
                        <a href="javascript:void(0);" style=" background-color: #ff3838;">
                            <input type="submit"    style="border:none;height: 2.3em;background-color:#ff3838;border-radius: 15px;display: block;color: #ffffff;margin-top: -21px; width: 80px;padding-left: 15px;" value="登录" ng-disabled='!createContactForm.$valid'/>
                        </a>
                        <a type="image" class="btn" onclick="cls()" style="background-color:#ff3838;border-radius: 13px;color:#fff;padding-top:4px;padding-left:18px;margin-right: 50px; margin-left: 230px;margin-top: -31px;display: block;width: 78px;height: 2.3em;border:none;" value="">重置</a>
                        <!--登录验证跳转-->

                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
<script>
    var ftitAppModule = angular.module('ftitApp', []);
</script>
<script type="text/javascript">

    function cls() {
        var sum = 0;
        var t = document.getElementsByClassName("clearText");
        for (var i = 0; i < t.length; i++) {
            if (t[i].type == 'text') {
                ++sum;
                t[i].value = "";//清空
            } else {
                ++sum;
                t[i].value = "";//清空
            }
        }
        var sum1 = 0;
        var t1 = document.getElementsByTagName("textarea");
        for (var i1 = 0; i1 < t1.length; i1++) {
            if (t1[i1].type == 'textarea') {
                ++sum1;
                t1[i1].value = "";//清空
            }
        }
    }
    $(function () {
        var mess = '<%=mess%>';
        if (mess == "-1") {
            alert("用户名或密码不能为空");
            top.location.href = "../login";
        } else if (mess == "-2") {
            alert("用户名不存在");
            top.location.href = "../login";
        } else if (mess == "-3") {
            alert("用户已禁用");
            top.location.href = "../login";
        } else if (mess == "-4") {
            alert("用户名或密码错误");
            top.location.href = "../login";
        } else if (mess == "-5") {
            alert("请先登录");
            top.location.href = "../login";
        }

        var url = location.href;
        var reg = /login\/-5/;
        if (reg.test(url)) {
            alert("请先登录");
            top.location.href = "../login";
        }
    })
</script>

<!--<form action="login" method="post">-->
<!--loginName:  <input name="txtLoginName" value="" style="width: 150px;height: 25px;"/>-->
<!--<br/>-->
<!--password:  <input name="txtPassword" value="" style="width: 150px;height: 25px;"/>-->
<!--<br/>-->
<!--<input type="submit" value="submit">-->
<!--</form>-->
</body>
</html>
